How to Use BETWEEN Correctly

The BETWEEN clause is used to validate if a value is in a range. For example – Obtain records with revenue amount in range [1000.00, 2000.00]

select * from sales where revenue between 1000.00 and 2000.00 ;

– The records of the last 7 days

select * from sales where sold_at between dateadd(day,-7,getdate()) and getdate() ;

IN THIS PAGE